import java.util.Scanner;

public class disiti {
    public static void main(String[] args) {
        int a;
        int b;
        Scanner scanner=new Scanner(System.in);
        System.out.println("输入a的值：");
        a= scanner.nextInt();
        System.out.println("请问要加多少项：");
        b= scanner.nextInt();
        int c=0;
        int d=a;
        for (int i=0;i<b;i++){
            c=c+a;
            a=10*a+d;
        }
        System.out.println("sum="+c);
    }
}
